package com.info.zhiduoduo.core.dto.dingdingnotice;

import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class DingdingNoticeMsg {

	/**
	 * msgtype : text
	 * text : {"content":"我就是我, 是不一样的烟火@156xxxx8827"}
	 * at : {"atMobiles":["156xxxx8827","189xxxx8325"],"isAtAll":false}
	 */

	private String msgtype;
	private TextBean text;
	private AtBean at;

	public static DingdingNoticeMsg of(String content, List<String> phones) {
		DingdingNoticeMsg msg = new DingdingNoticeMsg();
		msg.msgtype = "text";
		msg.text = new TextBean(content);
		msg.at = new AtBean(true, phones);
		return msg;
	}

	@Data
	@AllArgsConstructor
	@NoArgsConstructor
	public static class TextBean {

		/**
		 * content : 我就是我, 是不一样的烟火@156xxxx8827
		 */

		private String content;

	}

	@Data
	@AllArgsConstructor
	@NoArgsConstructor
	public static class AtBean {

		/**
		 * atMobiles : ["156xxxx8827","189xxxx8325"]
		 * isAtAll : false
		 */

		private boolean isAtAll;
		private List<String> atMobiles;

	}
}
